<link href="/assets/home/css/center.css" rel="stylesheet" />

<body>
    <!-- 头部 -->
    <div class="user">
        <div class="avatar wow fadeInUp">
            <img src="{$business.avatar_text}" />
        </div>

        <div class="nickname wow fadeInUp" data-wow-delay="100ms">{$business.nickname}</div>
    </div>

    <!-- 菜单 -->
    <div class="menulist wow fadeInUp" data-wow-delay="300ms">
        <a href="{:url('home/business/profile')}" class="item">
            <span>基本资料</span>
            <img src='/assets/home/images/row.png' />
        </a>
        {if condition="$business.auth == '0'"}
        <a href="{:url('home/business/email')}" class="item">
            <span>邮箱认证</span>
            <img src='/assets/home/images/row.png' />
        </a>
        {/if}
        <a href="{:url('home/business/order')}" class="item">
            <span>我的订单</span>
            <img src='/assets/home/images/row.png' />
        </a>
        <a href="{:url('home/business/record')}" class="item">
            <span>我的消费</span>
            <img src='/assets/home/images/row.png' />
        </a>
        <a href="{:url('home/business/pay')}" class="item">
            <span>充值</span>
            <img src='/assets/home/images/row.png' />
        </a>
        <a href="contact.html" class="item">
            <span>联系我们</span>
            <img src='/assets/home/images/row.png' />
        </a>
        <a id="logout" href="javascript:void(0)" class="item">
            <span>退出</span>
            <img src='/assets/home/images/row.png' />
        </a>
    </div>

    <!-- 底部 -->
    {include file="common/menu" /}
</body>


<script>
    $('#logout').click(() => {
        mui.confirm(
            '是否确认退出',
            '退出提醒',
            ['确认','取消'],
            function(res)
            {
                if(res.index === 0)
                {                    
                    // 关闭当前窗口
                    $('.mui-popup-backdrop').remove()
                    $('.mui-popup').remove()
                    location.href = `{:url('home/index/logout')}`
                }
            }
        )
    })

    if(Wechat())
    {
        $("#logout").remove()
    }
</script>